//
// api.js
// hs-admin
//
// Created by 区区电脑 on 2023/05/01.
//



import request from "@/request"

// 查询通知历史 分页
export function GetMessageInfoPageList(params = {}, data = {}) {
    return request({url: "/api/Message/GetMessageInfoPageList", method: "post", params, data})
}

// 阅读消息
export function UpdateMessageStatus(params = {}) {
    return request({url: "/api/Message/UpdateMessageStatus", method: "put", params})
}

// 一键已读
export function SetMessageRead(data = {}) {
    return request({url: "/api/Message/SetMessageRead", method: "post", data})
}
// 一键清空
export function CleanMessageInfo(data = {}) {
    return request({url: "/api/Message/CleanMessageInfo", method: "post", data})
}

// 修改用户密码
export function UpdateUserPassword(data) {
    return request({url: "/api/SysUser/UpdateUserPassword", method: "put", data})
}

/**
 * 使用验证码修改密码
 * @param data
 * @returns {Promise | Promise<unknown> | *}
 * @constructor
 */
export function UpdateUserPasswordByCode(data) {
    return request({url: "/api/SysUser/UpdateUserPasswordByCode", method: "post", data})
}


// 登录
export function Login(data) {
    return request({ url: `/api/Login/Login`, method: "post", data });
}

/**
 * 短信验证码登录
 * @param data
 * @returns {Promise | Promise<unknown> | *}
 * @constructor
 */
export function LoginByCode(data) {
    return request({ url: `/api/Login/LoginByCode`, method: "post", data });
}



export function GetCaptcha() {
    return request({url: "/api/Login/GetCaptcha", method: "get"})
}


// 获取用户详情
export function GetCurrentUserInfo(data) {
    return request({ url: `/api/Login/GetCurrentUserEntity`, method: "get", data });
}